package com.denso.workflow.admin;

import com.jfinal.core.Controller;
import com.jfinal.kit.PropKit;

/**
 * Created by lijian on 2018/9/22.
 */
public class AdminController extends Controller {

    public void index() {
        render("login.html");
    }

    public void login() {
        String name = getPara("name");
        String password = getPara("password");

        String adminPass = PropKit.get("adminPass");
        if(!name.equalsIgnoreCase("admin") ||
                !password.equalsIgnoreCase(adminPass)) {
            setAttr("notice", "登录信息不正确,请重新输入");
            render("login.html");
        } else {
            setSessionAttr("admin", name);
            redirect("/admin/image/index");
        }
    }
}
